package 客户复习;

public class Test {
    public static void main(String[] args) {
        String s1 ="www.tedu.com";
        String s2 ="http;//www.tarena.com.cn";
        String name1=getname(s1);
        String name2 =getname(s2);
        System.out.println(name1+1);
        System.out.println(name2);

    }

    public  static String getname(String url){
        int start = url.indexOf(".")+1;
        int end =url.indexOf(".",start);
        return url.substring(start,end);

    }
}
